package com.shangrila.biz.pojo;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.shangrila.common.lang.CalendarUtil;

/**
 * 精选商品
 * 
 * @author kalman03
 */
public class CarefullyChosenItems {

	private Long id;
	private Long itemId;
	private Long categoryLevel1;
	private Long categoryLevel2;
	private String reasons;
	private Date showDate;
	private String operator;
	private Date gmtCreate;
	private Date gmtModified;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getItemId() {
		return itemId;
	}

	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}
	public Long getCategoryLevel1() {
		return categoryLevel1;
	}

	public void setCategoryLevel1(Long categoryLevel1) {
		this.categoryLevel1 = categoryLevel1;
	}

	public Long getCategoryLevel2() {
		return categoryLevel2;
	}

	public void setCategoryLevel2(Long categoryLevel2) {
		this.categoryLevel2 = categoryLevel2;
	}

	public String getReasons() {
		return reasons;
	}

	public void setReasons(String reasons) {
		this.reasons = reasons;
	}

	public Date getShowDate() {
		return showDate;
	}

	public void setShowDate(Date showDate) {
		this.showDate = showDate;
	}

	public Date getGmtCreate() {
		return gmtCreate;
	}

	public void setGmtCreate(Date gmtCreate) {
		this.gmtCreate = gmtCreate;
	}

	public Date getGmtModified() {
		return gmtModified;
	}

	public void setGmtModified(Date gmtModified) {
		this.gmtModified = gmtModified;
	}
	
	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public List<String> getReasonList(){
		List<String> list = null;
		if(StringUtils.isNotBlank(reasons)){
			String [] rs = reasons.split("@");
			list = Arrays.asList(rs);
		}
		return list;
	}
	
	public String getParsedModifiedDate(){
		return CalendarUtil.formatDate(gmtModified, CalendarUtil.TIME_PATTERN);
	}
}
